package Demo2;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: homechen
 * Date: 2024-03-23
 * Time: 19:06
 */

class Animal {
    public void sound() {
        System.out.println("Animal sound!");
    }
}

class Dog extends Animal {
    // 重写
    @Override
    public void sound() {
        System.out.println("Dog sound!");
    }

    // 重载
    public void sound(int x) {
        for (int i = 0; i < x; i++) {
            System.out.println("Dog sound! " + i);
        }
    }
}

public class Test {
    //    public Integer func() {
//        return 1;
//    }
//    public String func() {
//        return "hello";
//    }
//    public static void main(String[] args) {
//        func();
//    }
    public static void main(String[] args) {
        Object o = new Object();
        // Integer i = new Integer();
        String str = new String();
    }
}
